const http = require('http')

const server = http.createServer()

server.on('request',(req,res)=>{
	const url = req.url
	const method = req.method
	const str = `您请求的地址是${url}, 请求的方法是${method}.`
	res.setHeader('Content-Type','text/html;charset=utf-8')
	res.end(str)
})

server.listen(8080, function(){
	console.log('Server running at http://127.0.0.1:8080')
})